def zconvert(s, rows):
    """

    N rows zigzag string of s
    :type s: str
    :type rows: int
    :rtype: str
    """
    totalLen = len(s);
    if totalLen <= rows or rows == 1:
        return s;

    stepLen = rows * 2 - 2;
    steps = totalLen // stepLen;
    cols = steps * 2;
    if totalLen % stepLen > rows:
        cols += 2;
    elif totalLen % stepLen > 0:
        cols += 1;
    
    newStr = [''] * (rows * cols);
    for i in range(0, totalLen):
        mod = i % stepLen;
        row = mod;
        col = i // stepLen * 2;
        if mod >= rows:
            col += 2;
            row = stepLen - mod;
        elif mod > 0:
            col += 1;
        newIndex = row * cols + col;
        newStr[newIndex] = s[i];

    return ''.join(newStr);
